<template>
    <div class="button">
        <button @click="getgoods">购物车</button>
        <button>去付款</button>
    </div>
    <div v-for="(item,index) in goods" :key="index">
        <div>
            <span>已选商品</span>
            <span>清空</span>
        </div>
        <div>
            <img :src="item.imgUrl" alt="">
            <div>
                <div>
                    <div v-if="item.discount!=''">折</div>
                    <div>{{item.name}}</div>
                </div>
                <div>
                    <button>-</button>
                    <span>{{item.count}}</span>
                    <button>+</button>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import {Merchants} from "../../api";


    export default {
        name: "DetailTabBarFooter",
        data() {
            return {
                id: 55,
                goods: [],
            }
        },
        methods: {
            getgoods() {
                Merchants(`/get-selected?${this.id}`).then(response => {
                        console.log(response.data)
                        this.goods = response.data
                    }
                )
            }

        }
    }
</script>

<style scoped>
    .button {
        position: fixed;
        bottom: 2vh;
    }
</style>